package factory;

import manager.ThreadPoolExecutorProxy;

public class ThreadPoolExecutorProxyFactory {
	/**普通的线程池代理*/
	static ThreadPoolExecutorProxy mNormalPoolExecutorProxy;
	/**下载的线程池代理*/
	static ThreadPoolExecutorProxy mDownLoadPoolExecutorProxy;
	
	public static ThreadPoolExecutorProxy getNormalPoolExecutorProxy(){
		if (mNormalPoolExecutorProxy == null) {
			synchronized (ThreadPoolExecutorProxy.class) {
				if (mNormalPoolExecutorProxy == null) {
					mNormalPoolExecutorProxy = new ThreadPoolExecutorProxy(5, 5, 3000);
					
				}
			}
		}
		return mNormalPoolExecutorProxy;
	}
	
	public static ThreadPoolExecutorProxy getDownLoadPoolExecutorProxy(){
		if (mDownLoadPoolExecutorProxy == null) {
			synchronized (ThreadPoolExecutorProxy.class) {
				if (mDownLoadPoolExecutorProxy == null) {
					//同一时刻只能执行三个任务
					mDownLoadPoolExecutorProxy = new ThreadPoolExecutorProxy(3, 3, 3000);
					
				}
			}
		}
		return mNormalPoolExecutorProxy;
	}
}
